package com.heg.api.tool;

import java.io.Serializable;

/**
 * 手机端请求响应返回数据模型(Model)
 * @author 邓绪招
 * @time 2016-04-02
 * @version 1.1.0
 */
public class ResponseModel implements Serializable {
	
	private static final long serialVersionUID = 1L;

	private Integer code;
	
	private String message;
	
	private Object result;
	
	public ResponseModel() {
	}
	
	public ResponseModel(Integer code, String message) {
		this.code = code;
		this.message = message;
	}

	public ResponseModel(Integer code, String message, Object result) {
		this.code = code;
		this.message = message;
		this.result = result;
	}
	
	public static ResponseModel as(Integer code, String message){
		return ResponseModel.as(code, message, null);
	}
	
	public static ResponseModel as(Integer code, String message, Object result){
		return ResponseModel.as(code, message, result);
	}

	/**
	 * 返回编码
	 * @return
	 */
	public Integer getCode() {
		return code;
	}
	
	public void setCode(Integer code) {
		this.code = code;
	}
	
	/**
	 * 返回信息
	 * @return
	 */
	public String getMessage() {
		return message;
	}
	
	public void setMessage(String message) {
		this.message = message;
	}
	
	/**
	 * 返回数据
	 * @return
	 */
	public Object getResult() {
		return result;
	}
	
	public void setResult(Object result) {
		this.result = result;
	}
	
}
